package com.blockchain.console.servlets.trading.xlb.xxcs;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.blockchain.console.service.trading.TradingManage;
import com.blockchain.console.servlets.trading.AbstractTradingServlet;
import com.blockchain.framework.http.servlet.annotation.Right;
import com.blockchain.framework.service.ServiceSession;
import com.blockchain.util.parser.IntegerParser;
@Right(id = "C_TRADING_DELETEXXCS", name = "虚拟币管理-参数-删除")
public class DeleteXxcs extends AbstractTradingServlet {

	private static final long serialVersionUID = 1L;

	@Override
	protected void processGet(HttpServletRequest request, HttpServletResponse response, ServiceSession serviceSession)
			throws Throwable {
		processPost(request, response, serviceSession);
	}

	@Override
	protected void processPost(final HttpServletRequest request, final HttpServletResponse response,
			final ServiceSession serviceSession) throws Throwable {
		TradingManage tsradingManage = serviceSession.getService(TradingManage.class);
		int id=IntegerParser.parse(request.getParameter("id"));
		int bid=IntegerParser.parse(request.getParameter("bid"));
		tsradingManage.deleteXxcs(id);
		String url=getController().getURI(request, XxcsList.class)+"?bid="+bid;
		sendRedirect(request, response,url);
	}

}
